﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using TomatoSynchronizer.Store;

namespace TomatoSynchronizer.Entities 
{

    public class WeightClassRule 
    {

        public WeightClassRule()
        {
        }
        
        public override bool Equals(object obj)
		{
			if(obj is WeightClassRule)
			{
				WeightClassRule rule = (WeightClassRule)obj;
				if(rule._weight_class_rule == _weight_class_rule && rule._weight_class_title == _weight_class_title)
				{
					return true;
				}
			}
			
			return false;
		}

        private JObject __jobject;
        public WeightClassRule(JObject obj)
        {
            this.__jobject = obj;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }        

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _weight_class_id;
        public string weight_class_id
        {
            get
            {
                if(_weight_class_id == null)
                    _weight_class_id = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "weight_class_id"));
                return _weight_class_id;
            }
            set
            {
                _weight_class_id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _weight_class_rule;
        public string weight_class_rule
        {
            get
            {
                if(_weight_class_rule == null)
                    _weight_class_rule = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "weight_class_rule"));
                return _weight_class_rule;
            }
            set
            {
                _weight_class_rule = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _weight_class_title;
        public string weight_class_title
        {
            get
            {
                if(_weight_class_title == null)
                    _weight_class_title = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "weight_class_title"));
                return _weight_class_title;
            }
            set
            {
                _weight_class_title = value;
            }
        }

    }
}
